#include <stdio.h>
#include <stdlib.h>

int
main(void)
{
	int n;
	//int a[100], b[100];
	int *pa, *pb;
	int i, j;
	int trace = 0;

	scanf("%d", &n);

	pa = malloc(n * n * sizeof (int));
	pb = malloc(n * n * sizeof (int));

	for (i = 0; i < n; ++i)
		for (j = 0; j < n; ++j)
			scanf("%d", pa + i * n + j);
	for (i = 0; i < n; ++i)
		for (j = 0; j < n; ++j)
			scanf("%d", pb + i * n + j);

	for (i = 0; i < n; ++i)
		trace += *(pa + i * (n + 1)) + *(pb + i * (n + 1));

	printf("%d\n", trace);

	return 0;
}
